package agricultural;

import strategy.WorkStrategy;
import strategy.impl.AdjustedHarvestingStrategy;
import strategy.impl.NormalHarvestingStrategy;

public class Harvester extends AgriculturalMachine {
    public Harvester(String machineId) {
        super(machineId);
        this.workStrategy = new NormalHarvestingStrategy();
    }

    @Override
    public void adjustToEnvironment(double soilMoisture, int cropGrowthStatus, String weatherData) {
        System.out.println(machineId + "收到环境数据更新通知");
        if (soilMoisture > 75) {
            setWorkStrategy(new AdjustedHarvestingStrategy());
        } else {
            setWorkStrategy(new NormalHarvestingStrategy());
        }
        performWork();
    }

    @Override
    public void update(double soilMoisture, int cropGrowthStatus, String weatherData) {

    }
}